
concrete TinyEng of Tiny = {

param PNum = Sg3 | NonSg3;
param Case = Nom | Acc;

lincat 

Phr, S = {s : Str};
NP, Subj = {s : Str; n : PNum}; 
DObj, IObj = {s : Str};
Pron = {s : Case => Str; n : PNum};
VP = {s : PNum => Str}; 
CN = {s : PNum => Str};
AP = {s : Str};
PP = {s : Str};
N = {s : PNum => Str};
A = {s : Str};
D = {s : Str; n : PNum};
V, V2 = {s : PNum => Str};
V3 = {s : PNum => Str; p : Str};
P = {s : Str};

lin

phrase s = s;
sent subj vp = {s = subj.s ++ vp.s!subj.n};
que subj vp = {s = do_does!subj.n ++ subj.s ++ vp.s!NonSg3};

useV v = v;
useV2 v do = {s = \\n => v.s!n ++ do.s};
useV3 v do io = {s = \\n => v.s!n ++ do.s ++ v.p ++ io.s};
ppVP vp pp = {s = \\n => vp.s!n ++ pp.s};

mkSubj np = np;
mkDObj np = np;
mkIObj np = np;
mkV1 v = v;
mkV2 v = v;

subjPron p = {s = p.s!Nom; n = p.n};
dobjPron p = {s = p.s!Acc; n = p.n};
iobjPron p = {s = p.s!Acc; n = p.n};

detCN d cn = {s = d.s ++ cn.s!d.n; n = d.n};
-- massNP cn = {s = cn.s!Sg3; n = Sg3};
ppNP np pp = {s = np.s ++ pp.s; n = np.n};

adjCN ap cn = {s = \\n => ap.s ++ cn.s!n};
useN n = n;

useP p np = {s = p.s ++ np.s};
useA a = a;

house = pnumS "house" "houses";
car = pnumS "car" "cars";
truckdriver = pnumS "truck driver" "truck drivers";
big = ss "big";
small = ss "small";
a = {s = "a"; n = Sg3};
theSg = {s = "the"; n = Sg3};
thePl = {s = "the"; n = NonSg3};
every = {s = "every"; n = Sg3};
all = {s = "all"; n = NonSg3};
indefPl = {s = ""; n = NonSg3};
run = pnumS "runs" "run";
sleep = pnumS "sleeps" "sleep";
see = pnumS "sees" "see";
hit = pnumS "hits" "hit";
give = pnumS "gives" "give" ** {p = "to"};
inn = ss "in";
over = ss "over";
under = ss "under";

i = mkpron "I" "me" NonSg3;
we = mkpron "we" "us" NonSg3;
you = mkpron "you" "you" NonSg3;
she = mkpron "she" "her" Sg3;
he = mkpron "he" "him" Sg3;
it = mkpron "it" "it" Sg3;
they = mkpron "they" "them" NonSg3;

oper 

do_does : PNum => Str
  = table {Sg3 => "does"; NonSg3 => "do"};
pnumS : Str -> Str -> {s : PNum => Str}
  = \sg,pl -> {s = table {Sg3 => sg; NonSg3 => pl}};
mkpron : Str -> Str -> PNum -> {s : Case => Str; n : PNum}
  = \nom,acc,n -> {s = table {Nom => nom; Acc => acc}; n = n};
ss : Str -> {s : Str} = \s -> {s = s};

}
